function [zero] = get_zero(x, y)
%UNTITLED3 Summary of this function goes here
%   Detailed explanation goes here
  sign = real(y(1:size(y, 2)-1)).*real(y(2:size(y, 2)));
  ind = find(sign < 0);
  if isempty(ind)
    ind = find(sign == 0, 1);
    if isempty(ind)
      zero = NaN;
    else
      zero = lambda(ind+1);
    end
  else
    if length(ind) > 1
      zero = (x(ind(length(ind)))+x(ind(length(ind))+1))/2;
    else
      zero = (x(ind)+x(ind+1))/2;
    end
  end
end

